<script setup lang="ts" >
import { RouterLink, RouterView } from 'vue-router'

const handleOpen = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
const handleClose = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}

import {
  Document,
  Menu as IconMenu,
  Location,
  Setting,
} from '@element-plus/icons-vue'
</script>

<template>
<!--  <header>-->
<!--    <img alt="Vue logo" class="logo" src="@/assets/logo.svg" width="125" height="125" />-->
<!--    <div class="wrapper">-->
<!--      <nav>-->
<!--        <RouterLink to="/">Home</RouterLink>-->
<!--        <RouterLink to="/about">About</RouterLink>-->
<!--      </nav>-->
<!--    </div>-->
<!--  </header>-->
  <el-row class="entire">
    <el-col :span="4" class="Nav">
      <h2 class="mb-2">vite练习项目</h2>
      <el-menu
          default-active="2"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
      >
        <el-sub-menu index="1">
          <template #title>
            <el-icon><location /></el-icon>
            <span>JS学习</span>
          </template>
          <router-link to="/1-1"><el-menu-item index="1-1">数据类型</el-menu-item></router-link>
          <router-link to="/1-2"><el-menu-item index="1-2">字符串</el-menu-item></router-link>
          <router-link to="/1-3"><el-menu-item index="1-3">表单验证</el-menu-item></router-link>
          <router-link to="/1-5"><el-menu-item index="1-5">拖拽</el-menu-item></router-link>
        </el-sub-menu>
        <el-menu-item index="2">
          <el-icon><icon-menu /></el-icon>
          <span>CSS学习</span>
        </el-menu-item>
        <el-menu-item index="3">
          <el-icon><document /></el-icon>
          <span>VUE学习</span>
        </el-menu-item>
        <el-menu-item index="4">
          <el-icon><setting /></el-icon>
          <span>其他</span>
        </el-menu-item>
      </el-menu>
    </el-col>
    <el-col :span="20">
      <RouterView style="padding: 20px"/>
    </el-col>
  </el-row>
</template>

<style >
a {
  text-decoration: none;
}
.entire{

}
</style>

